-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Add retry for eventual consistency bug in aws_iot_policy #34329
fix: Add retry for eventual consistency bug in aws_iot_policy #34329
Conversation
…instead of CreateDate
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @Octogonapus 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
…rsionId instead of CreateDate" This reverts commit 5d528f6.
…rce update" This reverts commit 9852ae0.
…x number is reached" This reverts commit 784897a.
% make testacc TESTARGS='-run=TestAccIoTPolicy_' PKG=iot ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 2 -run=TestAccIoTPolicy_ -timeout 360m === RUN TestAccIoTPolicy_basic === PAUSE TestAccIoTPolicy_basic === RUN TestAccIoTPolicy_disappears === PAUSE TestAccIoTPolicy_disappears === CONT TestAccIoTPolicy_basic === CONT TestAccIoTPolicy_disappears --- PASS: TestAccIoTPolicy_disappears (19.19s) --- PASS: TestAccIoTPolicy_basic (24.35s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/iot 29.768s
% make testacc TESTARGS='-run=TestAccIoTPolicy_' PKG=iot ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 2 -run=TestAccIoTPolicy_ -timeout 360m === RUN TestAccIoTPolicy_basic === PAUSE TestAccIoTPolicy_basic === RUN TestAccIoTPolicy_disappears === PAUSE TestAccIoTPolicy_disappears === RUN TestAccIoTPolicy_update === PAUSE TestAccIoTPolicy_update === CONT TestAccIoTPolicy_basic === CONT TestAccIoTPolicy_update --- PASS: TestAccIoTPolicy_basic (32.82s) === CONT TestAccIoTPolicy_disappears --- PASS: TestAccIoTPolicy_update (48.98s) --- PASS: TestAccIoTPolicy_disappears (17.41s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/iot 57.992s
…efault version of the policy if creating a new version would exceed the maximum number of versions (5).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccIoTPolicy_' PKG=iot ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 2 -run=TestAccIoTPolicy_ -timeout 360m
=== RUN TestAccIoTPolicy_basic
=== PAUSE TestAccIoTPolicy_basic
=== RUN TestAccIoTPolicy_disappears
=== PAUSE TestAccIoTPolicy_disappears
=== RUN TestAccIoTPolicy_update
=== PAUSE TestAccIoTPolicy_update
=== RUN TestAccIoTPolicy_prune
=== PAUSE TestAccIoTPolicy_prune
=== CONT TestAccIoTPolicy_basic
=== CONT TestAccIoTPolicy_update
--- PASS: TestAccIoTPolicy_basic (24.73s)
=== CONT TestAccIoTPolicy_prune
--- PASS: TestAccIoTPolicy_update (41.53s)
=== CONT TestAccIoTPolicy_disappears
--- PASS: TestAccIoTPolicy_disappears (18.50s)
--- PASS: TestAccIoTPolicy_prune (113.81s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/iot 143.701s
% make testacc TESTARGS='-run=TestAccIoTPolicyAttachment_' PKG=iot ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 2 -run=TestAccIoTPolicyAttachment_ -timeout 360m
=== RUN TestAccIoTPolicyAttachment_basic
--- PASS: TestAccIoTPolicyAttachment_basic (65.89s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/iot 71.572s
@Octogonapus Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.26.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
This PR adds retries into the delete logic for
aws_iot_policy
.This resource currently has a bug where it can fail to delete because a just-deleted policy attachment
has not yet propagated through AWS's system.
These retries have been added to fix that bug.
Relations
Closes #9541.
Relates #9540.
Closes #30314.
Closes #24979.
References
The AWS API documentation notes that it can take up to five minutes after a policy is detached before it's ready to be deleted: https://docs.aws.amazon.com/iot/latest/apireference/API_DetachPolicy.html
Output from Acceptance Testing